import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '名称',
    align: "center",
    sorter: true,
    dataIndex: 'name'
  },
  {
    title: '状态',
    align: "center",
    sorter: true,
    dataIndex: 'state_dictText'
  },
  {
    title: '排序',
    align: "center",
    sorter: true,
    dataIndex: 'sort'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "名称",
    field: 'name',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: "状态",
    field: 'state',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "dict_item_status"
    },
    colProps: { span: 6 },
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'sort',
    component: 'InputNumber',
  },
  {
    label: '状态',
    field: 'state',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: "dict_item_status"
    },
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
